<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<stripes:useActionBean beanclass="simple.web.UsersActionBean" var="bean" />
<stripes:layout-render name="${pageContext.request.contextPath}/stripes/default.jsp" title="Stripes Users">
    <stripes:layout-component name="JS">
        <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/dataTables/js/jquery.dataTables.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                var oTable = $('#userTable').dataTable({
                    "bPaginate": false,
                    "bLengthChange": false,
                    "oLanguage": { "sSearch": "Filter records:" },
                    "bJQueryUI": true,
                    "sPaginationType": "full_numbers"
                });
                $('#userTable').css("width", "100%");
            });
        </script>
    </stripes:layout-component>

    <stripes:layout-component name="contents">
        <p>Stripes Users</p>
        <table id="userTable">
            <thead>
            <tr>
                <th>First Name</th>
                <th>Last Name</th>
                <th>Birthday</th>
            </tr>
            </thead>
            <tbody>
            <%--@elvariable id="user" type="simple.persistence.entity.User"--%>
            <c:forEach items="${bean.users}" var="user">
                <tr>
                    <td><c:out value="${user.firstName}"/></td>
                    <td><c:out value="${user.lastName}"/></td>
                    <td><fmt:formatDate dateStyle="short" value="${user.birthday}"/></td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </stripes:layout-component>
</stripes:layout-render>
